package soundsystem;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by qiangjindong
 * 2018-08-27 15:09
 */
public class SoundSystemMain {

    public static void main(String[] args) {
        xmlInject();
//        javaInject();
    }

    public static void javaInject() {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(CDPlayConfig.class);
        CDPlayer player = context.getBean(CDPlayer.class);
        player.play();
    }


    public static void xmlInject() {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("META-INF/spring/soundsystem-config.xml");
        CDPlayer player = context.getBean(CDPlayer.class);
        player.play();
    }
}
